import React, { useEffect } from 'react'
import { Outlet, Link } from 'react-router-dom'
console.log('home加载了')
export default function Home() {
  useEffect(() => {
    console.log('Home组件挂载了')
    return () => {
      console.log('Home组件卸载了')
    }
  }, [])
  return (
    <div>
      <h1>Home</h1>
      <Link to="/home/test1" replace>
        test1
      </Link>
      <Link to="/home/test2">test2</Link>

      <div>首页顶部的内容</div>
      {/* Outlet组件写在哪里,决定了当前路由组件中的子级路由组件渲染在哪里 */}
      <Outlet></Outlet>
      <div>首页底部的内容</div>
    </div>
  )
}
